<?php
include 'su_log';
include '../inc/d.php';
if (isset($_POST['name'])) {
    if (empty($_FILES)) {
        echo '请选择上传文件';
    } elseif (emtpy(trim($_POST['name']))) {
        echo '请输入资质名称';
    } else {
        $filename = date('YmdHis') . '.jpg';
        move_uploaded_file($_FILES['filename']['tmp_name'], '../upload/zizhi/' . $filename);
        $arr_assoc['zizhi_name'] = $_POST['name'];
        $arr_assoc['zizhi_filename'] = $filename;
        $arr_assoc['zizhi_time'] = time();
        $arr_assoc['zizhi_flag'] = $_POST['flag'];
        save('hw_zizhi', $arr_assoc);
        header('location:zizhi_manager.php');
    }
}
?>

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>admin</title>
</head>
<body>

<h3>添加资质</h3>

<form action="" method="post" enctype="multipart/form-data">
    资质名称：<input type="text" name="name" size="80" autofocus><br>
    资质照片：<input type="file" name="filename"><br>
    是否显示:
    <label><input type="radio" name="flag" value="y" checked>显示</label>&nbsp;
    <label><input type="radio" name="flag" value="n">不显示</label><br>
    <hr>
    <input type="submit" value="提交">
</form>

</body>
</html>



